package service

import (
	"week-three/global"
	"week-three/internal/model/dao"
	"week-three/internal/request"
)

func Add(req request.About) (dao.About, error) {
	about := dao.About{
		Name:     req.Name,
		Color:    req.Color,
		Rand:     req.Rand,
		Buy:      req.Buy,
		IdStatus: req.IdStatus,
		Data:     req.Data,
		Use:      req.Use,
		Look:     req.Look,
	}
	err := global.DB.Create(&about).Error
	return about, err
}
